import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

/// Text 组件的扩展
extension MagmaTextExtension on Text {
  //  Black Han Sans 样式
  Text blackHanSans({Color? color, FontWeight? fontWeight, double? fontSize}) {
    return Text(
      data ?? '',
      style: GoogleFonts.blackHanSans(
        fontWeight: fontWeight ?? FontWeight.w400,
        fontSize: fontSize ?? 24.sp,
        color: color ?? Colors.white,
      ),
      textAlign: textAlign,
      textDirection: textDirection,
      locale: locale,
      softWrap: softWrap,
      overflow: overflow,
      textScaler: textScaler,
      maxLines: maxLines,
      semanticsLabel: semanticsLabel,
      textWidthBasis: textWidthBasis,
      textHeightBehavior: textHeightBehavior,
      selectionColor: selectionColor,
    );
  }

  Text inter({Color? color, FontWeight? fontWeight, double? fontSize}) {
    return Text(
      data ?? '',
      style: GoogleFonts.inter(
        fontWeight: fontWeight ?? FontWeight.w600,
        fontSize: fontSize ?? 20.sp,
        color: color ?? Colors.black87,
      ),
      textAlign: textAlign,
      textDirection: textDirection,
      locale: locale,
      softWrap: softWrap,
      overflow: overflow,
      textScaler: textScaler,
      maxLines: maxLines,
      semanticsLabel: semanticsLabel,
      textWidthBasis: textWidthBasis,
      textHeightBehavior: textHeightBehavior,
      selectionColor: selectionColor,
    );
  }
}
